import com.speljohan.rsbot.script.Random;
import com.speljohan.rsbot.script.wrappers.RSTile;

public class Maze extends Random {
	RSTile[] Area1PATH = { new RSTile(2893, 4554), new RSTile(2890, 4566) };
	RSTile[] SEAST3PATH = { new RSTile(2927, 4551), new RSTile(2936, 4556) };

	@Override
	public boolean activateCondition() {
		if (!isLoggedIn()) {
			return false;
		}

		if (findObject(3626) != null || findObject(3649) != null) {
			setCompass('n');
			return true;
		}

		return false;
	}

	public boolean Area1() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2909 && myX >= 2889 && myY >= 4553 && myY <= 4554) {
			return true;
		}

		return false;
	}

	public boolean Area10() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2921 && myX >= 2920 && myY >= 4567 && myY <= 4580) {
			return true;
		}

		return false;
	}

	public boolean Area10b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2921 && myX >= 2914 && myY >= 4567 && myY <= 4568) {
			return true;
		}

		return false;
	}

	public boolean Area11() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2919 && myX >= 2905 && myY >= 4569 && myY <= 4570) {
			return true;
		}

		return false;
	}

	public boolean Area11b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2906 && myX >= 2905 && myY >= 4569 && myY <= 4580) {
			return true;
		}

		return false;
	}

	public boolean Area12() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2926 && myX >= 2906 && myY >= 4586 && myY <= 4587) {
			return true;
		}

		return false;
	}

	public boolean Area13() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2921 && myX >= 2910 && myY >= 4584 && myY <= 4585) {
			return true;
		}

		return false;
	}

	public boolean Area13b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2921 && myX >= 2920 && myY >= 4581 && myY <= 4585) {
			return true;
		}

		return false;
	}

	public boolean Area14() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2919 && myX >= 2905 && myY >= 4582 && myY <= 4583) {
			return true;
		}

		return false;
	}

	public boolean Area15() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2917 && myX >= 2907 && myY >= 4580 && myY <= 4581) {
			return true;
		}

		return false;
	}

	public boolean Area15b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2917 && myX >= 2907 && myY >= 4571 && myY <= 4572) {
			return true;
		}

		return false;
	}

	public boolean Area1b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2890 && myX >= 2889 && myY >= 4553 && myY <= 4575) {
			return true;
		}

		return false;
	}

	public boolean Area2() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2892 && myX >= 2891 && myY >= 4562 && myY <= 4585) {
			return true;
		}

		return false;
	}

	public boolean Area3() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2894 && myX >= 2893 && myY >= 4557 && myY <= 4581) {
			return true;
		}

		return false;
	}

	public boolean Area4() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2896 && myX >= 2895 && myY >= 4559 && myY <= 4581) {
			return true;
		}

		return false;
	}

	public boolean Area4b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2901 && myX >= 2895 && myY >= 4559 && myY <= 4560) {
			return true;
		}

		return false;
	}

	public boolean Area5() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2907 && myX >= 2897 && myY >= 4561 && myY <= 4562) {
			return true;
		}

		return false;
	}

	public boolean Area6() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2927 && myX >= 2902 && myY >= 4559 && myY <= 4560) {
			return true;
		}

		return false;
	}

	public boolean Area7() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2927 && myX >= 2908 && myY >= 4561 && myY <= 4562) {
			return true;
		}

		return false;
	}

	public boolean Area8() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2925 && myX >= 2905 && myY >= 4563 && myY <= 4564) {
			return true;
		}

		return false;
	}

	public boolean Area8b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2925 && myX >= 2924 && myY >= 4563 && myY <= 4572) {
			return true;
		}

		return false;
	}

	public boolean Area9() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2923 && myX >= 2922 && myY >= 4565 && myY <= 4579) {
			return true;
		}

		return false;
	}

	@Override
	public String getAuthor() {
		return "Killa";
	}

	@Override
	public String getName() {
		return "Maze";
	}

	@Override
	public double getVersion() {
		return 1.0;
	}

	@Override
	public int loop() {
		if (getMyPlayer().isMoving()) {
			return random(0, 150);
		}
		if (getMyPlayer().getLocation().equals(new RSTile(2911, 4567))) {
			walkTileMM(new RSTile(2904, 4573));
			return random(500, 1000);
		}
		if ((NWest10() || NWest10b())
				&& distanceTo(new RSTile(2911, 4566)) >= 4) {
			walkTileMM(new RSTile(2911, 4566));
			return random(500, 1000);
		}
		if ((NWest10() || NWest10b())
				&& distanceTo(new RSTile(2911, 4567)) <= 4) {
			setCompass('N');
			atTile(new RSTile(2911, 4567), "Open");
			return random(500, 1000);
		}
		if (NWest9() && distanceTo(new RSTile(2900, 4567)) >= 4) {
			walkTileMM(new RSTile(2900, 4567));
			return random(500, 1000);
		}
		if (NWest9() && distanceTo(new RSTile(2901, 4567)) <= 4) {
			setCompass('w');
			atTile(new RSTile(2901, 4567), "Open");
			return random(500, 1000);
		}
		if (NWest8() && distanceTo(new RSTile(2898, 4570)) >= 4) {
			walkTileMM(new RSTile(2898, 4570));
			return random(500, 1000);
		}
		if (NWest8() && distanceTo(new RSTile(2899, 4570)) <= 4) {
			setCompass('w');
			atTile(new RSTile(2899, 4570), "Open");
			return random(500, 1000);
		}
		if (NWest7() && distanceTo(new RSTile(2896, 4582)) >= 4) {
			walkTileMM(new RSTile(2896, 4582));
			return random(500, 1000);
		}
		if (NWest7() && distanceTo(new RSTile(2897, 4582)) <= 4) {
			setCompass('w');
			atTile(new RSTile(2897, 4582), "Open");
			return random(500, 1000);
		}
		if ((NWest6() || NWest6b()) && distanceTo(new RSTile(2894, 4587)) >= 4) {
			walkTileMM(new RSTile(2894, 4587));
			return random(500, 1000);
		}
		if ((NWest6() || NWest6b()) && distanceTo(new RSTile(2895, 4587)) <= 4) {
			setCompass('w');
			atTile(new RSTile(2895, 4587), "Open");
			return random(500, 1000);
		}
		if (NWest5() && distanceTo(new RSTile(2897, 4596)) >= 4) {
			walkTileMM(new RSTile(2897, 4596));
			return random(500, 1000);
		}
		if (NWest5() && distanceTo(new RSTile(2897, 4595)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2897, 4595), "Open");
			return random(500, 1000);
		}
		if (NWest4() && distanceTo(new RSTile(2901, 4598)) >= 4) {
			walkTileMM(new RSTile(2901, 4598));
			return random(500, 1000);
		}
		if (NWest4() && distanceTo(new RSTile(2901, 4597)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2901, 4597), "Open");
			return random(500, 1000);
		}
		if ((NWest3() || NWest3b()) && distanceTo(new RSTile(2893, 4600)) >= 4) {
			walkTileMM(new RSTile(2893, 4600));
			return random(500, 1000);
		}
		if ((NWest3() || NWest3b()) && distanceTo(new RSTile(2893, 4599)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2893, 4599), "Open");
			return random(500, 1000);
		}
		if (NWest2() && distanceTo(new RSTile(2889, 4596)) >= 4) {
			walkTileMM(new RSTile(2889, 4596));
			return random(500, 1000);
		}
		if (NWest2() && distanceTo(new RSTile(2888, 4596)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2888, 4596), "Open");
			return random(500, 1000);
		}
		if ((NWest1() || NWest1b()) && distanceTo(new RSTile(2891, 4588)) >= 4) {
			walkTileMM(new RSTile(2891, 4588));
			return random(500, 1000);
		}
		if ((NWest1() || NWest1b()) && distanceTo(new RSTile(2890, 4588)) <= 4) {
			setCameraAltitude(true);
			setCompass('e');
			atTile(new RSTile(2890, 4588), "Open");
			return random(500, 1000);
		}
		if (distanceTo(new RSTile(2891, 4566)) >= 4 && (Area1() || Area1b())) {
			setCameraAltitude(true);
			walkPathMM(Area1PATH, 20);
			return random(500, 1000);
		}
		if (distanceTo(new RSTile(2891, 4566)) <= 4 && (Area1() || Area1b())) {
			setCompass('w');
			setCameraAltitude(true);
			atTile(new RSTile(2891, 4566), "Open");
			return random(500, 1000);
		}
		if (Area2() && distanceTo(new RSTile(2893, 4578)) >= 4) {
			walkTo(new RSTile(2892, 4578));
			return random(500, 1000);
		}
		if (Area2() && distanceTo(new RSTile(2893, 4578)) <= 4) {
			setCompass('w');
			setCameraAltitude(true);
			atTile(new RSTile(2893, 4578), "Open");
			return random(500, 1000);
		}
		if (Area3() && distanceTo(new RSTile(2895, 4567)) >= 4) {
			walkTo(new RSTile(2894, 4567));
			return random(500, 1000);
		}
		if (Area3() && distanceTo(new RSTile(2895, 4567)) <= 4) {
			setCompass('w');
			setCameraAltitude(true);
			atTile(new RSTile(2895, 4567), "Open");
			return random(500, 1000);
		}
		if ((Area4() || Area4b()) && distanceTo(new RSTile(2896, 4562)) >= 2) {
			walkTo(new RSTile(2896, 4562));
			return random(500, 1000);
		}
		if ((Area4() || Area4b()) && distanceTo(new RSTile(2896, 4562)) <= 3) {
			setCompass('w');
			setCameraAltitude(true);
			atTile(new RSTile(2897, 4562), "Open");
			return random(500, 1000);
		}
		if (Area5() && distanceTo(new RSTile(2905, 4561)) >= 4) {
			walkTo(new RSTile(2905, 4561));
			return random(500, 1000);
		}
		if (Area5() && distanceTo(new RSTile(2905, 4560)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2905, 4560), "Open");
			return random(500, 1000);
		}
		if (Area6() && distanceTo(new RSTile(2915, 4561)) <= 4) {
			setCompass('N');
			atTile(new RSTile(2915, 4561), "Open");
			return random(500, 1000);
		}
		if (Area6() && distanceTo(new RSTile(2915, 4561)) >= 4) {
			walkTo(new RSTile(2915, 4560));
			return random(500, 1000);
		}
		if (Area7() && distanceTo(new RSTile(2909, 4563)) <= 3) {
			setCompass('N');
			atTile(new RSTile(2909, 4563), "Open");
			return random(500, 1000);
		}
		if (Area7() && distanceTo(new RSTile(2909, 4563)) >= 3) {
			walkTo(new RSTile(2909, 4562));
			return random(500, 1000);
		}
		if ((Area8() || Area8b()) && distanceTo(new RSTile(2923, 4566)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2923, 4566), "Open");
			return random(500, 1000);
		}
		if ((Area8b() || Area8()) && distanceTo(new RSTile(2923, 4566)) >= 4) {
			walkTo(new RSTile(2924, 4566));
			return random(500, 1000);
		}
		if (Area9() && distanceTo(new RSTile(2921, 4575)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2921, 4575), "Open");
			return random(500, 1000);
		}
		if (Area9() && distanceTo(new RSTile(2921, 4575)) >= 4) {
			walkTo(new RSTile(2922, 4575));
			return random(500, 1000);
		}
		if ((Area10() || Area10b()) && distanceTo(new RSTile(2916, 4569)) <= 4) {
			setCompass('N');
			atTile(new RSTile(2916, 4569), "Open");
			return random(500, 1000);
		}
		if ((Area10b() || Area10()) && distanceTo(new RSTile(2916, 4569)) >= 4) {
			walkTo(new RSTile(2916, 4568));
			return random(500, 1000);
		}
		if ((Area11() || Area11b()) && distanceTo(new RSTile(2904, 4573)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2904, 4573), "Open");
			return random(500, 1000);
		}
		if ((Area11b() || Area11()) && distanceTo(new RSTile(2904, 4573)) >= 4) {
			walkTo(new RSTile(2905, 4573));
			return random(500, 1000);
		}
		if (getMyPlayer().getLocation().equals(new RSTile(2904, 4573))
				|| getMyPlayer().getLocation().equals(new RSTile(2903, 4575))) {
			walkTo(new RSTile(2906, 4585));
			return random(500, 1000);
		}
		if (distanceTo(new RSTile(2906, 4586)) <= 4 && !Area12()
				&& distanceTo(new RSTile(2910, 4581)) > 4 && !NEast9()
				&& !NEast9b() && !NEast10() && !NEast10b()) {
			setCompass('N');
			atTile(new RSTile(2906, 4586), "Open");
			return random(500, 1000);
		}
		if (Area12() && distanceTo(new RSTile(2916, 4586)) >= 4) {
			walkTo(new RSTile(2916, 4586));
			return random(500, 1000);
		}
		if (Area12() && distanceTo(new RSTile(2916, 4585)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2916, 4585), "Open");
			return random(500, 1000);
		}
		if (Area13() && distanceTo(new RSTile(2920, 4582)) >= 4) {
			walkTo(new RSTile(2920, 4582));
			return random(500, 1000);
		}
		if (Area13b() && distanceTo(new RSTile(2919, 4582)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2919, 4582), "Open");
			return random(500, 1000);
		}
		if (Area14() && distanceTo(new RSTile(2910, 4582)) >= 4) {
			walkTo(new RSTile(2910, 4582));
			return random(500, 1000);
		}
		if (Area14() && distanceTo(new RSTile(2910, 4581)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2910, 4581), "Open");
			return random(500, 1000);
		}
		if (Area15()) {
			setCameraAltitude(true);
			walkTo(new RSTile(2910, 4572));
			return random(500, 1000);
		}
		if (Area15b() && distanceTo(new RSTile(2910, 4573)) <= 4) {
			setCompass('N');
			setCameraAltitude(true);
			atTile(new RSTile(2910, 4573), "Open");
			return random(500, 1000);
		}
		if (distanceTo(new RSTile(2911, 4576)) <= 5
				&& !getMyPlayer().getLocation().equals(new RSTile(2911, 4576))) {
			setCompass('w');
			setCameraAltitude(true);
			atTile(new RSTile(2911, 4576), "Open");
			return random(500, 1000);
		}
		if (distanceTo(new RSTile(2912, 4576)) <= 1 && !NEast9() && !NEast9b()) {
			setCameraRotation(130);
			setCameraAltitude(false);
			atObject(getObjectAt(2911, 4576), "Touch");
			log.info("Done.");
			return random(500, 1000);
		}
		if ((NewArea1() || NewArea1b())
				&& distanceTo(new RSTile(2903, 4555)) >= 4) {
			setCompass('s');
			setCameraAltitude(true);
			walkTo(new RSTile(2903, 4555));
			return random(500, 1000);
		}
		if ((NewArea1() || NewArea1b())
				&& distanceTo(new RSTile(2903, 4555)) <= 4) {
			setCompass('s');
			setCameraAltitude(true);
			atTile(new RSTile(2903, 4554), "Open");
			return random(500, 1000);
		}
		if ((NEast1() || NEast1b()) && distanceTo(new RSTile(2932, 4597)) >= 4) {
			setCompass('N');
			setCameraAltitude(true);
			walkTo(new RSTile(2932, 4597));
			return random(500, 1000);
		}
		if ((NEast1() || NEast1b()) && distanceTo(new RSTile(2932, 4598)) <= 4) {
			setCompass('N');
			setCameraAltitude(true);
			atTile(new RSTile(2932, 4598), "Open");
			return random(500, 1000);
		}
		if (NEast2() && distanceTo(new RSTile(2921, 4599)) >= 4) {
			setCompass('N');
			setCameraAltitude(true);
			walkTo(new RSTile(2921, 4599));
			return random(500, 1000);
		}
		if (NEast2() && distanceTo(new RSTile(2921, 4600)) <= 4) {
			setCompass('N');
			setCameraAltitude(true);
			atTile(new RSTile(2921, 4600), "Open");
			return random(500, 1000);
		}
		if (NEast3() && distanceTo(new RSTile(2909, 4600)) >= 4) {
			walkTo(new RSTile(2909, 4600));
			return random(500, 1000);
		}
		if (NEast3() && distanceTo(new RSTile(2909, 4599)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2909, 4599), "Open");
			return random(500, 1000);
		}
		if (NEast4() && distanceTo(new RSTile(2913, 4598)) >= 3) {
			walkTo(new RSTile(2913, 4598));
			return random(500, 1000);
		}
		if (NEast4() && distanceTo(new RSTile(2913, 4597)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2913, 4597), "Open");
			return random(500, 1000);
		}
		if (NEast5() && distanceTo(new RSTile(2908, 4596)) >= 4) {
			walkTo(new RSTile(2908, 4596));
			return random(500, 1000);
		}
		if (NEast5() && distanceTo(new RSTile(2908, 4595)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2908, 4595), "Open");
			return random(500, 1000);
		}
		if (NEast6() && distanceTo(new RSTile(2919, 4594)) >= 4) {
			walkTo(new RSTile(2919, 4594));
			return random(500, 1000);
		}
		if (NEast6() && distanceTo(new RSTile(2919, 4593)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2919, 4593), "Open");
			return random(500, 1000);
		}
		if (NEast7() && distanceTo(new RSTile(2908, 4591)) >= 4) {
			walkTo(new RSTile(2908, 4592));
			return random(500, 1000);
		}
		if (NEast7() && distanceTo(new RSTile(2908, 4591)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2908, 4591), "Open");
			return random(500, 1000);
		}
		if ((NEast8() || NEast8b()) && distanceTo(new RSTile(2899, 4585)) >= 4) {
			walkTo(new RSTile(2898, 4585));
			return random(500, 1000);
		}
		if ((NEast8() || NEast8b()) && distanceTo(new RSTile(2899, 4585)) <= 4) {
			setCompass('w');
			atTile(new RSTile(2899, 4585), "Open");
			return random(500, 1000);
		}
		if ((NEast9() || NEast9b()) && distanceTo(new RSTile(2903, 4588)) >= 4) {
			walkTo(new RSTile(2903, 4588));
			return random(500, 1000);
		}
		if ((NEast9() || NEast9b()) && distanceTo(new RSTile(2903, 4587)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2903, 4587), "Open");
			return random(500, 1000);
		}
		if ((NEast10() || NEast10b())
				&& distanceTo(new RSTile(2902, 4575)) >= 4) {
			walkTo(new RSTile(2902, 4575));
			return random(500, 1000);
		}
		if ((NEast10() || NEast10b())
				&& distanceTo(new RSTile(2903, 4575)) <= 4) {
			setCompass('w');
			atTile(new RSTile(2903, 4575), "Open");
			return random(500, 1000);
		}
		if ((SEast1() || SEast1b()) && distanceTo(new RSTile(2930, 4555)) >= 4) {
			setCameraAltitude(true);
			setCompass('s');
			walkTo(new RSTile(2930, 4555));
			return random(500, 1000);
		}
		if ((SEast1() || SEast1b()) && distanceTo(new RSTile(2930, 4554)) <= 4) {
			setCameraAltitude(true);
			setCompass('s');
			atTile(new RSTile(2930, 4554), "Open");
			return random(500, 1000);
		}
		if (SEast2() && distanceTo(new RSTile(2912, 4553)) >= 4) {
			setCompass('e');
			walkTo(new RSTile(2912, 4553));
			return random(500, 1000);
		}
		if (SEast2() && distanceTo(new RSTile(2912, 4552)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2912, 4552), "Open");
			return random(500, 1000);
		}
		if ((SEast3() || SEast3b()) && distanceTo(new RSTile(2936, 4556)) >= 4) {
			walkPathMM(SEAST3PATH, 20);
			return random(500, 1000);
		}
		if ((SEast3() || SEast3b()) && distanceTo(new RSTile(2935, 4556)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2935, 4556), "Open");
			return random(500, 1000);
		}
		if (SEast4() && distanceTo(new RSTile(2933, 4568)) >= 4) {
			walkTileMM(new RSTile(2934, 4568));
			return random(500, 1000);
		}
		if (SEast4() && distanceTo(new RSTile(2933, 4568)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2933, 4568), "Open");
			return random(500, 1000);
		}
		if (SEast5() && distanceTo(new RSTile(2932, 4575)) >= 4) {
			walkTileMM(new RSTile(2932, 4575));
			return random(500, 1000);
		}
		if (SEast5() && distanceTo(new RSTile(2931, 4575)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2931, 4575), "Open");
			return random(500, 1000);
		}
		if (SEast6() && distanceTo(new RSTile(2930, 4561)) >= 4) {
			walkTileMM(new RSTile(2930, 4561));
			return random(500, 1000);
		}
		if (SEast6() && distanceTo(new RSTile(2929, 4561)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2929, 4561), "Open");
			return random(500, 1000);
		}
		if (SEast7() && distanceTo(new RSTile(2929, 4581)) >= 4) {
			walkTileMM(new RSTile(2929, 4580));
			return random(500, 1000);
		}
		if (SEast7() && distanceTo(new RSTile(2929, 4581)) <= 4) {
			setCompass('w');
			atTile(new RSTile(2930, 4581), "Open");
			return random(500, 1000);
		}
		if (SEast8() && distanceTo(new RSTile(2930, 4590)) >= 4) {
			walkTileMM(new RSTile(2930, 4590));
			return random(500, 1000);
		}
		if (SEast8() && distanceTo(new RSTile(2929, 4590)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2929, 4590), "Open");
			return random(500, 1000);
		}
		if ((SEast9b() || SEast9()) && distanceTo(new RSTile(2924, 4592)) >= 4) {
			walkTileMM(new RSTile(2924, 4592));
			return random(500, 1000);
		}
		if ((SEast9b() || SEast9()) && distanceTo(new RSTile(2924, 4591)) <= 4) {
			setCompass('s');
			atTile(new RSTile(2924, 4591), "Open");
			return random(500, 1000);
		}
		if ((SEast10b() || SEast10())
				&& distanceTo(new RSTile(2926, 4575)) >= 4) {
			walkTileMM(new RSTile(2926, 4575));
			return random(500, 1000);
		}
		if ((SEast10b() || SEast10())
				&& distanceTo(new RSTile(2925, 4575)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2925, 4575), "Open");
			return random(500, 1000);
		}
		if (SEast11() && distanceTo(new RSTile(2924, 4583)) >= 4) {
			walkTileMM(new RSTile(2924, 4583));
			return random(500, 1000);
		}
		if (SEast11() && distanceTo(new RSTile(2923, 4583)) <= 4) {
			setCompass('e');
			atTile(new RSTile(2923, 4583), "Open");
			return random(500, 1000);
		}
		if (getMyPlayer().getLocation().equals(new RSTile(2923, 4583))) {
			walkTileMM(new RSTile(2916, 4586));
			return random(500, 1000);
		}
		if (!NWest1() && !NWest2() && !NWest1b() && !NWest3b() && !NWest3()
				&& !NWest4() && !NWest5() && !NWest6() && !NWest6b()
				&& !NWest7() && !NWest8() && !NWest9() && !NWest10()
				&& !NWest10b() && !SEast9()
				&& !getMyPlayer().getLocation().equals(new RSTile(2911, 4567))
				&& !SEast9b() && !SEast10b() && !SEast10() && !SEast11()
				&& !getMyPlayer().getLocation().equals(new RSTile(2923, 4583))
				&& !(distanceTo(new RSTile(2912, 4576)) <= 1)
				&& !(distanceTo(new RSTile(2911, 4576)) <= 5) && !Area15b()
				&& !Area14() && !Area13b() && !Area13() && !Area12()
				&& !(distanceTo(new RSTile(2906, 4586)) <= 4)
				&& !getMyPlayer().getLocation().equals(new RSTile(2904, 4573))
				&& !Area11b() && !Area11() && !Area10() && !Area10b()
				&& !Area9() && !Area8b() && !Area8() && !Area7() && !Area6()
				&& !Area4() && !Area5() && !Area3() && !Area2() && !Area1()
				&& !Area1b() && !NewArea1() && !NewArea1b() && !NewArea2()
				&& !NEast1b() && !NEast1() && !NEast2() && !NEast4()
				&& !NEast3() && !NEast4() && !NEast5() && !NEast6()
				&& !NEast7() && !NEast8() && !SEast8() && !NEast8b()
				&& !NEast9() && !NEast9b() && !NEast10() && !NEast10b()
				&& !SEast1() && !SEast1b() && !SEast2() && !SEast3()
				&& !SEast3b() && !SEast4() && !SEast5() && !SEast6()
				&& !getMyPlayer().getLocation().equals(new RSTile(2903, 4575))
				&& (findObject(3626) != null || findObject(3649) != null)) {
			log
					.severe("Contact Killa, This part of the maze isn't coded yet. I might need your account.");
			logout();
			stopAllScripts();
		}
		return -1;
	}

	public boolean NEast1() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2933 && myX >= 2918 && myY >= 4596 && myY <= 4597) {
			return true;
		}
		return false;
	}

	public boolean NEast10() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2905 && myX >= 2901 && myY >= 4586 && myY <= 4587) {
			return true;
		}

		return false;
	}

	public boolean NEast10b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2902 && myX >= 2901 && myY >= 4572 && myY <= 4587) {
			return true;
		}

		return false;
	}

	public boolean NEast1b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2933 && myX >= 2932 && myY >= 4580 && myY <= 4597) {
			return true;
		}

		return false;
	}

	public boolean NEast2() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2935 && myX >= 2917 && myY >= 4598 && myY <= 4599) {
			return true;
		}

		return false;
	}

	public boolean NEast3() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2937 && myX >= 2906 && myY >= 4600 && myY <= 4601) {
			return true;
		}

		return false;
	}

	public boolean NEast4() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2916 && myX >= 2904 && myY >= 4598 && myY <= 4599) {
			return true;
		}

		return false;
	}

	public boolean NEast5() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2917 && myX >= 2906 && myY >= 4596 && myY <= 4597) {
			return true;
		}

		return false;
	}

	public boolean NEast6() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2929 && myX >= 2902 && myY >= 4594 && myY <= 4595) {
			return true;
		}

		return false;
	}

	public boolean NEast7() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2921 && myX >= 2895 && myY >= 4592 && myY <= 4593) {
			return true;
		}

		return false;
	}

	public boolean NEast8() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2916 && myX >= 2897 && myY >= 4590 && myY <= 4591) {
			return true;
		}

		return false;
	}

	public boolean NEast8b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2898 && myX >= 2897 && myY >= 4584 && myY <= 4591) {
			return true;
		}

		return false;
	}

	public boolean NEast9() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2900 && myX >= 2899 && myY >= 4579 && myY <= 4589) {
			return true;
		}

		return false;
	}

	public boolean NEast9b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2914 && myX >= 2899 && myY >= 4588 && myY <= 4589) {
			return true;
		}

		return false;
	}

	public boolean NewArea1() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2914 && myX >= 2891 && myY >= 4555 && myY <= 4556) {
			return true;
		}

		return false;
	}

	public boolean NewArea1b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2892 && myX >= 2891 && myY >= 4561 && myY <= 4555) {
			return true;
		}

		return false;
	}

	public boolean NewArea2() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2909 && myX >= 2889 && myY >= 4553 && myY <= 4554) {
			return true;
		}

		return false;
	}

	public boolean NWest1() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2894 && myX >= 2891 && myY >= 4596 && myY <= 4597) {
			return true;
		}

		return false;
	}

	public boolean NWest10() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2902 && myX >= 2901 && myY >= 4565 && myY <= 4571) {
			return true;
		}

		return false;
	}

	public boolean NWest10b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2918 && myX >= 2901 && myY >= 4565 && myY <= 4566) {
			return true;
		}

		return false;
	}

	public boolean NWest1b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2892 && myX >= 2891 && myY >= 4586 && myY <= 4597) {
			return true;
		}

		return false;
	}

	public boolean NWest2() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2890 && myX >= 2889 && myY >= 4576 && myY <= 4599) {
			return true;
		}

		return false;
	}

	public boolean NWest3() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2888 && myX >= 2887 && myY >= 4574 && myY <= 4601) {
			return true;
		}

		return false;
	}

	public boolean NWest3b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2905 && myX >= 2887 && myY >= 4600 && myY <= 4601) {
			return true;
		}

		return false;
	}

	public boolean NWest4() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2903 && myX >= 2891 && myY >= 4598 && myY <= 4599) {
			return true;
		}

		return false;
	}

	public boolean NWest5() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2905 && myX >= 2895 && myY >= 4596 && myY <= 4597) {
			return true;
		}

		return false;
	}

	public boolean NWest6() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2901 && myX >= 2893 && myY >= 4594 && myY <= 4595) {
			return true;
		}

		return false;
	}

	public boolean NWest6b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2894 && myX >= 2893 && myY >= 4582 && myY <= 4595) {
			return true;
		}

		return false;
	}

	public boolean NWest7() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2896 && myX >= 2895 && myY >= 4582 && myY <= 4591) {
			return true;
		}

		return false;
	}

	public boolean NWest8() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2898 && myX >= 2897 && myY >= 4567 && myY <= 4583) {
			return true;
		}

		return false;
	}

	public boolean NWest9() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2900 && myX >= 2899 && myY >= 4563 && myY <= 4578) {
			return true;
		}

		return false;
	}

	public boolean SEast1() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2933 && myX >= 2932 && myY >= 4555 && myY <= 4560) {
			return true;
		}

		return false;
	}

	public boolean SEast10() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2927 && myX >= 2918 && myY >= 4590 && myY <= 4591) {
			return true;
		}

		return false;
	}

	public boolean SEast10b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2927 && myX >= 2926 && myY >= 4553 && myY <= 4591) {
			return true;
		}

		return false;
	}

	public boolean SEast11() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2925 && myX >= 2924 && myY >= 4573 && myY <= 4589) {
			return true;
		}

		return false;
	}

	public boolean SEast1b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2933 && myX >= 2915 && myY >= 4555 && myY <= 4556) {
			return true;
		}

		return false;
	}

	public boolean SEast2() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2933 && myX >= 2910 && myY >= 4553 && myY <= 4554) {
			return true;
		}

		return false;
	}

	public boolean SEast3() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2937 && myX >= 2901 && myY >= 4551 && myY <= 4552) {
			return true;
		}

		return false;
	}

	public boolean SEast3b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2937 && myX >= 2936 && myY >= 4551 && myY <= 4572) {
			return true;
		}

		return false;
	}

	public boolean SEast4() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2935 && myX >= 2934 && myY >= 4553 && myY <= 4578) {
			return true;
		}

		return false;
	}

	public boolean SEast5() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2933 && myX >= 2932 && myY >= 4553 && myY <= 4578) {
			return true;
		}

		return false;
	}

	public boolean SEast6() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2931 && myX >= 2930 && myY >= 4557 && myY <= 4577) {
			return true;
		}

		return false;
	}

	public boolean SEast7() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2929 && myX >= 2928 && myY >= 4559 && myY <= 4585) {
			return true;
		}

		return false;
	}

	public boolean SEast8() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2931 && myX >= 2930 && myY >= 4578 && myY <= 4595) {
			return true;
		}

		return false;
	}

	public boolean SEast9() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2929 && myX >= 2928 && myY >= 4586 && myY <= 4593) {
			return true;
		}

		return false;
	}

	public boolean SEast9b() {
		final RSTile myLocation = getMyPlayer().getLocation();
		final int myX = myLocation.getX();
		final int myY = myLocation.getY();

		if (myX <= 2929 && myX >= 2922 && myY >= 4592 && myY <= 4593) {
			return true;
		}

		return false;
	}
}